package cn.edu.nju.software.smartup.data;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.ResolveInfo;

public class application {
	private ResolveInfo resolveInfo;

	public application() {

	}

	public application(ResolveInfo resolveInfo) {
		this.resolveInfo = resolveInfo;
	}

	public void startup(Activity activity) {
		Intent intent = new Intent();
		intent.setClassName(resolveInfo.activityInfo.packageName,
				resolveInfo.activityInfo.name);
		activity.startActivity(intent);
	}

	public String getDescription(Activity activity) {
		return (String) resolveInfo.activityInfo.applicationInfo
				.loadDescription(activity.getPackageManager());
	}
	
	public String getProcessName(){
		return resolveInfo.activityInfo.applicationInfo.processName;
	}
	
	public ResolveInfo getResolveInfo() {
		return resolveInfo;
	}

	public void setResolveInfo(ResolveInfo resolveInfo) {
		this.resolveInfo = resolveInfo;
	}

	public String loadLabel(Activity activity){
		return (String) resolveInfo.activityInfo.applicationInfo.loadLabel(activity.getPackageManager());
	}
}
